#ifndef GY_GRAPHICSRECTITEM_H
#define GY_GRAPHICSRECTITEM_H

#include "Graphics/BasicGraphics/GY_BasicsGraphicsObject.h"
#include "Graphics/GY_Object.h"
#include "GY_ControlLibrary_global.h"
#include <QGraphicsRectItem>
#include <QObject>
#include <QVariant>
#include <QPointF>
/**
 * @brief The GY_GraphicsRectItem class 矩形图元基类
 */
class GY_CONTROLLIBRARY_EXPORT GY_GraphicsRectItem : public GY_BasicsGraphicsObject
{
    Q_OBJECT
public:
    explicit Q_INVOKABLE GY_GraphicsRectItem(const QString &guid,QGraphicsItem *parent = nullptr);
    explicit Q_INVOKABLE GY_GraphicsRectItem(const QString &guid,const QPointF &point1,const QPointF &point2, QGraphicsItem *parent = nullptr);
    ~GY_GraphicsRectItem(){}
    /**
     * @brief updatePoint 更新点位
     * @param name 属性名称
     * @param value 属性值
     * @return 是否更新成功
     */
    bool updatePoint(const QString &name, const QVariant &value);
    /**
     * @brief updatePath 设置路径
     * @param p1 点一
     * @param p2 点二
     * @param p3 点三
     * @param p4 点四
     */
    void updatePath(const QPointF &p1,const QPointF &p2,const QPointF &p3,const QPointF &p4);
    /**
     * @brief initializationPropertyInfo 初始化属性
     */
    void initializationPropertyInfo();

signals:


    // QGraphicsItem interface
public:
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
};

#endif // GY_GRAPHICSRECTITEM_H
